<template>
  <div class="card" @click="toAnimeMain(data.id)">
    <div class="cover">
      <BaseImg :src="data.cover" />
    </div>
    <span>{{ data.animeTitle }}</span>
  </div>
</template>

<script>
import BaseImg from '../Global/BaseImg.vue'

import { toAnimeMain } from '@/router/jump.js'

export default {
  name: 'Card3D',
  components: {
    BaseImg
  },
  props: {
    data: {
      default: {}
    }
  },
  setup() {
    return {
      toAnimeMain
    }
  }
}
</script>

<style lang="scss" scoped>
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  .cover {
    width: 180px;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
  }
  span {
    user-select: none;
    cursor: pointer;
    margin-top: 10px;
    text-align: center;
    display: block;
    width: 140px;
    color: $font;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
</style>
